package test;

public class PeopleCount {
    public static void main(String[] args) {
        for (int i = 1; i <= 30; i++) {
            for (int j = 1; j <= 30; j++) {
                for (int k = 1; k <= 30; k++) {
                    if (i*3+j*2+k*1 == 50 && i+j+k == 30){
                        System.out.println("有男人："+i+"\t有女人："+j+"\t有小孩："+k);
                    }
                }
            }
        }
    }
}
